package com.itheima.reflect;

public class Student {
    protected String username;
    protected int age;

    public Student() {
        System.out.println("无参构造器");
    }

    public Student(String username, int age) {
        this.username = username;
        this.age = age;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
    public String  eat(String name){
        System.out.println("我被执行了"+name);
        return "吃方法"+name;
    }

    @Override
    public String toString() {
        return "Student{" +
                "username='" + username + '\'' +
                ", age=" + age +
                '}';
    }
}

